{template 'common/header-base'}
<style type="text/css">
    .we7-table td{
      text-align: center;
    }
</style>
{if $op == 'display'}
<form class="form-horizontal" action="" method="post">
    <table class="table we7-table table-hover article-list vertical-middle">
        <tr>
            <td style="width:100px">排序</td>
            <td>用户昵称</td>
            <td>用户头像</td>
            <td>兑换单号</td>
            <td>兑换所用积分</td>
            <!-- <td>兑换所用金额</td> -->
            <td>兑换商品名称</td>
            <td>兑换商品图片</td>
            <td>兑换时间</td>
            <td>兑换状态</td>
            <td class="text-right">操作</td>
        </tr>
        {loop $products $item}
        <tr>
            <td>
                {$item['id']}
            </td>
            <td>
                {$item['u_name']}
            </td>         
            <td>
                <img src="{media $item['u_thumb']}" style="width: 100px;height: 100px;" alt="">
            </td>
            <td>
                {$item['jnum']}
            </td>
            <td>
                {$item['jifen']}
            </td>
            <!-- <td>
                {$item['money']}元
            </td> -->
            <td>
                {$item['j_name']}
            </td>
            <td>
                <img src="{media $item['j_thumb']}" style="width: 100px;height: 100px;" alt="">
            </td>
            <td>
                {$item['time']}
            </td>
            <td>
                {if $item['statues']==0} <a class="btn btn-danger btn-sm">失败</a>{/if}
                {if $item['statues']==1} <a class="btn btn-info btn-sm" onclick="return confirm('确认已发货？'); return false;" href="{php echo $this->createWeburl('userjifen', array('id' => $item['id'], 'op' => 'post'))}">点击发货</a>{/if}
                {if $item['statues']==2} <a class="btn btn-warning btn-sm" onclick="return confirm('确认商家已收货？'); return false;" href="{php echo $this->createWeburl('userjifen', array('id' => $item['id'], 'op' => 'post1'))}">点击完成</a>{/if}
                {if $item['statues']==3} <a class="btn btn-success btn-sm">成功</a> {/if}
            </td>
            <td class="text-right">
                <a class="btn btn-danger btn-sm" onclick="return confirm('此操作不可恢复，确认吗？'); return false;" href="{php echo $this->createWeburl('userjifen', array('id' => $item['id'], 'op' => 'delete'))}">删除</a>
            </td>
        </tr>
        {/loop}
    </table>
</form>
{/if}